package com.dd.reggie.controller;

import com.dd.reggie.common.R;
import com.dd.reggie.dto.OrdersDto;
import com.dd.reggie.entity.Orders;
import com.dd.reggie.service.OrdersDetailService;
import com.dd.reggie.service.OrdersService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.persistence.criteria.Order;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrdersController {

    @Autowired
    private OrdersService ordersService;

    @Autowired
    private OrdersDetailService ordersDetailService;

    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){

        log.info(orders.toString());

        ordersService.submit(orders);

        return R.success("生成外卖订单");
    }

}
